home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / firese1a / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-26  |  17.1 KB  |  585 lines

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  4. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  5. Begin VB.Form mainwin 
  6.    BorderStyle     =   0  'None
  7.    Caption         =   "FireSearch "
  8.    ClientHeight    =   7545
  9.    ClientLeft      =   45
  10.    ClientTop       =   615
  11.    ClientWidth     =   9855
  12.    Icon            =   "Form1.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   7545
  16.    ScaleWidth      =   9855
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin RichTextLib.RichTextBox RtfBox 
  19.       Height          =   495
  20.       Left            =   480
  21.       TabIndex        =   15
  22.       Top             =   8880
  23.       Width           =   9015
  24.       _ExtentX        =   15901
  25.       _ExtentY        =   873
  26.       _Version        =   327681
  27.       Enabled         =   -1  'True
  28.       ScrollBars      =   3
  29.       TextRTF         =   $"Form1.frx":0442
  30.    End
  31.    Begin MSComDlg.CommonDialog CdlEdit 
  32.       Left            =   4560
  33.       Top             =   1080
  34.       _ExtentX        =   847
  35.       _ExtentY        =   847
  36.       _Version        =   327681
  37.    End
  38.    Begin VB.PictureBox Picture3 
  39.       Height          =   615
  40.       Left            =   5400
  41.       Picture         =   "Form1.frx":050B
  42.       ScaleHeight     =   555
  43.       ScaleWidth      =   555
  44.       TabIndex        =   14
  45.       Top             =   1080
  46.       Visible         =   0   'False
  47.       Width           =   615
  48.    End
  49.    Begin FireSearch.URLLink URLLink1 
  50.       Height          =   255
  51.       Left            =   2520
  52.       TabIndex        =   13
  53.       ToolTipText     =   "Open current page in new browser window"
  54.       Top             =   2160
  55.       Width           =   1575
  56.       _ExtentX        =   2778
  57.       _ExtentY        =   450
  58.    End
  59.    Begin VB.TextBox Text1 
  60.       Height          =   1095
  61.       Left            =   480
  62.       TabIndex        =   12
  63.       Top             =   8880
  64.       Visible         =   0   'False
  65.       Width           =   9015
  66.    End
  67.    Begin VB.CommandButton Command1 
  68.       Caption         =   "&Begin new search"
  69.       Height          =   435
  70.       Left            =   6240
  71.       TabIndex        =   9
  72.       ToolTipText     =   "Reset and begin a new search session"
  73.       Top             =   1080
  74.       Width           =   3255
  75.    End
  76.    Begin VB.CommandButton button_search 
  77.       Caption         =   "S&earch"
  78.       Default         =   -1  'True
  79.       Height          =   435
  80.       Left            =   6240
  81.       TabIndex        =   0
  82.       ToolTipText     =   "Begin search"
  83.       Top             =   120
  84.       Width           =   3255
  85.    End
  86.    Begin VB.CommandButton Command4 
  87.       Caption         =   "&Stop Search"
  88.       Height          =   435
  89.       Left            =   6240
  90.       TabIndex        =   4
  91.       ToolTipText     =   "Cancel search"
  92.       Top             =   600
  93.       Width           =   3255
  94.    End
  95.    Begin VB.ComboBox engine 
  96.       Height          =   315
  97.       Left            =   480
  98.       Style           =   2  'Dropdown List
  99.       TabIndex        =   5
  100.       ToolTipText     =   "Select a search engine"
  101.       Top             =   660
  102.       Width           =   1575
  103.    End
  104.    Begin VB.Frame Frame1 
  105.       Caption         =   "Results"
  106.       Height          =   5895
  107.       Left            =   120
  108.       TabIndex        =   2
  109.       Top             =   1560
  110.       Width           =   9615
  111.       Begin VB.CommandButton Command3 
  112.          Caption         =   "Forward"
  113.          Height          =   615
  114.          Left            =   1560
  115.          MaskColor       =   &H00FFFFFF&
  116.          Picture         =   "Form1.frx":094D
  117.          Style           =   1  'Graphical
  118.          TabIndex        =   17
  119.          Top             =   240
  120.          Width           =   735
  121.       End
  122.       Begin VB.CommandButton Command5 
  123.          Caption         =   "Stop"
  124.          Height          =   615
  125.          Left            =   840
  126.          MaskColor       =   &H00FFFFFF&
  127.          Picture         =   "Form1.frx":0C57
  128.          Style           =   1  'Graphical
  129.          TabIndex        =   18
  130.          Top             =   240
  131.          Width           =   735
  132.       End
  133.       Begin VB.CommandButton Command2 
  134.          Caption         =   "Back"
  135.          Height          =   615
  136.          Left            =   120
  137.          MaskColor       =   &H00FFFFFF&
  138.          Picture         =   "Form1.frx":0F61
  139.          Style           =   1  'Graphical
  140.          TabIndex        =   16
  141.          Top             =   240
  142.          Width           =   735
  143.       End
  144.       Begin VB.PictureBox Picture1 
  145.          BackColor       =   &H00FFFFFF&
  146.          BorderStyle     =   0  'None
  147.          Height          =   1215
  148.          Left            =   3840
  149.          Picture         =   "Form1.frx":126B
  150.          ScaleHeight     =   1215
  151.          ScaleWidth      =   1935
  152.          TabIndex        =   8
  153.          Top             =   2760
  154.          Width           =   1935
  155.       End
  156.       Begin VB.PictureBox Picture2 
  157.          BackColor       =   &H00FFFFFF&
  158.          Height          =   4815
  159.          Left            =   120
  160.          ScaleHeight     =   4755
  161.          ScaleWidth      =   9315
  162.          TabIndex        =   10
  163.          ToolTipText     =   "Your search results are displayed here"
  164.          Top             =   960
  165.          Width           =   9375
  166.       End
  167.       Begin SHDocVwCtl.WebBrowser results 
  168.          Height          =   4815
  169.          Left            =   120
  170.          TabIndex        =   3
  171.          ToolTipText     =   "Your search results are displayed here"
  172.          Top             =   960
  173.          Width           =   9375
  174.          ExtentX         =   16536
  175.          ExtentY         =   8493
  176.          ViewMode        =   1
  177.          Offline         =   0
  178.          Silent          =   0
  179.          RegisterAsBrowser=   0
  180.          RegisterAsDropTarget=   1
  181.          AutoArrange     =   -1  'True
  182.          NoClientEdge    =   0   'False
  183.          AlignLeft       =   0   'False
  184.          ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  185.          Location        =   ""
  186.       End
  187.    End
  188.    Begin VB.TextBox searchtext 
  189.       Height          =   315
  190.       Left            =   2400
  191.       TabIndex        =   1
  192.       ToolTipText     =   "Type the keywords you wish to search for"
  193.       Top             =   660
  194.       Width           =   3495
  195.    End
  196.    Begin VB.Image Image6 
  197.       Height          =   480
  198.       Left            =   2880
  199.       Picture         =   "Form1.frx":205B
  200.       Top             =   1080
  201.       Visible         =   0   'False
  202.       Width           =   480
  203.    End
  204.    Begin VB.Image Image5 
  205.       Height          =   480
  206.       Left            =   2400
  207.       Picture         =   "Form1.frx":2365
  208.       Top             =   1080
  209.       Visible         =   0   'False
  210.       Width           =   480
  211.    End
  212.    Begin VB.Image Image4 
  213.       Height          =   480
  214.       Left            =   1920
  215.       Picture         =   "Form1.frx":266F
  216.       Top             =   1080
  217.       Visible         =   0   'False
  218.       Width           =   480
  219.    End
  220.    Begin VB.Image Image3 
  221.       Height          =   480
  222.       Left            =   1440
  223.       Picture         =   "Form1.frx":2979
  224.       Top             =   1080
  225.       Visible         =   0   'False
  226.       Width           =   480
  227.    End
  228.    Begin VB.Image Image2 
  229.       Height          =   480
  230.       Left            =   840
  231.       Picture         =   "Form1.frx":2C83
  232.       Top             =   1080
  233.       Visible         =   0   'False
  234.       Width           =   480
  235.    End
  236.    Begin VB.Image Image1 
  237.       Height          =   480
  238.       Left            =   240
  239.       Picture         =   "Form1.frx":2F8D
  240.       Top             =   1080
  241.       Visible         =   0   'False
  242.       Width           =   480
  243.    End
  244.    Begin VB.Line Line1 
  245.       X1              =   -1680
  246.       X2              =   9960
  247.       Y1              =   0
  248.       Y2              =   0
  249.    End
  250.    Begin VB.Line Line2 
  251.       BorderColor     =   &H80000005&
  252.       BorderWidth     =   2
  253.       X1              =   0
  254.       X2              =   9975
  255.       Y1              =   0
  256.       Y2              =   15
  257.    End
  258.    Begin VB.Label Label3 
  259.       Caption         =   "Label3"
  260.       Height          =   495
  261.       Left            =   3480
  262.       TabIndex        =   11
  263.       Top             =   6720
  264.       Width           =   5655
  265.    End
  266.    Begin VB.Label Label2 
  267.       Caption         =   "Enter text to search for:"
  268.       Height          =   375
  269.       Left            =   2400
  270.       TabIndex        =   7
  271.       Top             =   360
  272.       Width           =   2295
  273.    End
  274.    Begin VB.Label Label1 
  275.       Caption         =   "Select search engine:"
  276.       Height          =   375
  277.       Left            =   480
  278.       TabIndex        =   6
  279.       Top             =   360
  280.       Width           =   1935
  281.    End
  282.    Begin VB.Menu popmenu 
  283.       Caption         =   "&Menu"
  284.       Visible         =   0   'False
  285.       Begin VB.Menu popmenuhide 
  286.          Caption         =   "&Hide"
  287.       End
  288.       Begin VB.Menu menu_spacer02 
  289.          Caption         =   "-"
  290.       End
  291.       Begin VB.Menu popmenuabout 
  292.          Caption         =   "&About FireSearch"
  293.       End
  294.       Begin VB.Menu menu_spacer03 
  295.          Caption         =   "-"
  296.       End
  297.       Begin VB.Menu popmenumin 
  298.          Caption         =   "Mi&nimize"
  299.       End
  300.       Begin VB.Menu popmenumax 
  301.          Caption         =   "Ma&ximize"
  302.       End
  303.       Begin VB.Menu menu_spacer01 
  304.          Caption         =   "-"
  305.       End
  306.       Begin VB.Menu popmenuexit 
  307.          Caption         =   "&Exit"
  308.       End
  309.    End
  310.    Begin VB.Menu file 
  311.       Caption         =   "&File"
  312.       Begin VB.Menu filesearch 
  313.          Caption         =   "&Search"
  314.          Begin VB.Menu filesearchnew 
  315.             Caption         =   "&New"
  316.             Shortcut        =   ^N
  317.          End
  318.          Begin VB.Menu filesearchopen 
  319.             Caption         =   "&Open"
  320.             Shortcut        =   ^O
  321.          End
  322.       End
  323.       Begin VB.Menu filereset 
  324.          Caption         =   "&Reset"
  325.          Begin VB.Menu fileresetall 
  326.             Caption         =   "Reset &All"
  327.             Shortcut        =   ^R
  328.          End
  329.          Begin VB.Menu fileresetengine 
  330.             Caption         =   "Search &Engine"
  331.             Shortcut        =   ^E
  332.          End
  333.          Begin VB.Menu fileresettext 
  334.             Caption         =   "Search &Text"
  335.             Shortcut        =   ^T
  336.          End
  337.          Begin VB.Menu fileresetwin 
  338.             Caption         =   "Results &Window"
  339.             Shortcut        =   ^W
  340.          End
  341.       End
  342.       Begin VB.Menu filestop 
  343.          Caption         =   "Sto&p Search"
  344.          Shortcut        =   ^P
  345.       End
  346.       Begin VB.Menu menu_spacer04 
  347.          Caption         =   "-"
  348.       End
  349.       Begin VB.Menu fileexit 
  350.          Caption         =   "&Exit"
  351.          Shortcut        =   ^X
  352.       End
  353.    End
  354.    Begin VB.Menu mnuhelp 
  355.       Caption         =   "&Help"
  356.       Begin VB.Menu mnuhelpabout 
  357.          Caption         =   "&About..."
  358.          Shortcut        =   ^A
  359.       End
  360.    End
  361. Attribute VB_Name = "mainwin"
  362. Attribute VB_GlobalNameSpace = False
  363. Attribute VB_Creatable = False
  364. Attribute VB_PredeclaredId = True
  365. Attribute VB_Exposed = False
  366. Private Sub button_search_Click()
  367. If engine.Text = "" <> False Then
  368.     MsgBox "Choose a search engine from the list", vbCritical, "Search Error"
  369.     Else
  370. If mainwin.searchtext.Text <> "" = False Then
  371.     MsgBox "Enter some key words to search for", vbCritical, "Search Error"
  372.     searchtext.Text = "Enter search words here"
  373.     searchtext.SetFocus
  374.     Else
  375.     Picture1.Visible = False
  376.     Picture2.Visible = False
  377.     textsearch = searchtext.Text
  378.     engine = mainwin.engine.Text
  379.     textsearch = StrConv(textsearch, vbLowerCase)
  380.     Call search.search
  381. End If
  382. End If
  383. End Sub
  384. Private Sub Command1_Click()
  385.     engine.Clear
  386.     engine.AddItem "Yahoo"
  387.     engine.AddItem "HotBot"
  388.     engine.AddItem "Lycos"
  389.     engine.AddItem "AltaVista"
  390.     engine.AddItem "MSN"
  391.     engine.AddItem "Infoseek"
  392.     engine.AddItem "Mamma"
  393.     engine.AddItem "Dogpile"
  394.     searchtext.Text = ""
  395.     Picture1.Visible = True
  396.     Picture2.Visible = True
  397. End Sub
  398. Private Sub Command2_Click()
  399.     On Error GoTo errorhandler
  400.     results.GoBack
  401. Exit Sub
  402. errorhandler:
  403. End Sub
  404. Private Sub Command2_GotFocus()
  405.     Command2.Picture = Image1.Picture
  406. End Sub
  407. Private Sub Command2_LostFocus()
  408.     Command2.Picture = Image2.Picture
  409. End Sub
  410. Private Sub Command3_Click()
  411. On Error GoTo errorhandler
  412.     results.GoForward
  413. Exit Sub
  414. errorhandler:
  415. End Sub
  416. Private Sub Command3_GotFocus()
  417.     Command3.Picture = Image3.Picture
  418. End Sub
  419. Private Sub Command3_LostFocus()
  420.     Command3.Picture = Image4.Picture
  421. End Sub
  422. Private Sub Command4_Click()
  423.     mainwin.results.Stop
  424. End Sub
  425. Private Sub Command5_Click()
  426. On Error GoTo errorhandler
  427.     mainwin.results.Stop
  428. Exit Sub
  429. errorhandler:
  430. End Sub
  431. Private Sub Command5_GotFocus()
  432.     Command5.Picture = Image5.Picture
  433. End Sub
  434. Private Sub Command5_LostFocus()
  435.     Command5.Picture = Image6.Picture
  436. End Sub
  437. Private Sub fileexit_Click()
  438.     Unload frmAbout
  439.     Unload Me
  440. End Sub
  441. Private Sub fileresetall_Click()
  442.     engine.Clear
  443.     engine.AddItem "Yahoo"
  444.     engine.AddItem "HotBot"
  445.     engine.AddItem "Lycos"
  446.     engine.AddItem "AltaVista"
  447.     engine.AddItem "MSN"
  448.     engine.AddItem "Infoseek"
  449.     engine.AddItem "Mamma"
  450.     engine.AddItem "Dogpile"
  451.     searchtext.Text = ""
  452.     Picture1.Visible = True
  453.     Picture2.Visible = True
  454. End Sub
  455. Private Sub fileresetengine_Click()
  456.     engine.Clear
  457.     engine.AddItem "Yahoo"
  458.     engine.AddItem "HotBot"
  459.     engine.AddItem "Lycos"
  460.     engine.AddItem "AltaVista"
  461.     engine.AddItem "MSN"
  462.     engine.AddItem "Infoseek"
  463.     engine.AddItem "Mamma"
  464.     engine.AddItem "Dogpile"
  465. End Sub
  466. Private Sub fileresettext_Click()
  467.     searchtext.Text = ""
  468. End Sub
  469. Private Sub fileresetwin_Click()
  470.     Picture1.Visible = True
  471.     Picture2.Visible = True
  472. End Sub
  473. Private Sub filesearchnew_Click()
  474.     engine.Clear
  475.     engine.AddItem "Yahoo"
  476.     engine.AddItem "HotBot"
  477.     engine.AddItem "Lycos"
  478.     engine.AddItem "AltaVista"
  479.     engine.AddItem "MSN"
  480.     engine.AddItem "Infoseek"
  481.     engine.AddItem "Mamma"
  482.     engine.AddItem "Dogpile"
  483.     searchtext.Text = ""
  484.     Picture1.Visible = True
  485.     Picture2.Visible = True
  486. End Sub
  487. Private Sub filesearchopen_Click()
  488.     CdlEdit.filename = ""
  489. On Error GoTo errorhandler
  490.     With CdlEdit
  491.         .Flags = cdlOFNExplorer
  492.         .CancelError = False
  493.         .Filter = "All Files (*.*)|*.*|Web Pages (*.htm;*.html)|*.htm;*.html|"
  494.         .FilterIndex = 2
  495.         .InitDir = App.Path
  496.         .ShowOpen
  497.     End With
  498.     Picture1.Visible = False
  499.     Picture2.Visible = False
  500.     results.Navigate CdlEdit.filename
  501.     Exit Sub
  502. errorhandler:
  503. End Sub
  504. Private Sub filestop_Click()
  505.     mainwin.results.Stop
  506. End Sub
  507. Private Sub Form_Load()
  508.     engine.AddItem "Yahoo"
  509.     engine.AddItem "HotBot"
  510.     engine.AddItem "Lycos"
  511.     engine.AddItem "AltaVista"
  512.     engine.AddItem "MSN"
  513.     engine.AddItem "Infoseek"
  514.     engine.AddItem "Mamma"
  515.     engine.AddItem "Dogpile"
  516.     CreateIcon
  517. End Sub
  518. Private Sub Form_Unload(Cancel As Integer)
  519.     DeleteIcon
  520. End Sub
  521. Private Sub mnuhelpabout_Click()
  522.     Load frmAbout
  523.     frmAbout.Visible = True
  524. End Sub
  525. Private Sub popmenuabout_Click()
  526.     Load frmAbout
  527.     frmAbout.Visible = True
  528. End Sub
  529. Private Sub popmenuexit_Click()
  530.     Unload frmAbout
  531.     Unload Me
  532. End Sub
  533. Private Sub popmenuhide_Click()
  534. If mainwin.Visible = True Then
  535.     popmenuhide.Checked = True
  536.     mainwin.Visible = False
  537.     popmenuhide.Checked = False
  538.     mainwin.Visible = True
  539. End If
  540. End Sub
  541. Private Sub popmenumax_Click()
  542. mainwin.WindowState = 0
  543. End Sub
  544. Private Sub popmenumin_Click()
  545.     mainwin.WindowState = 1
  546. End Sub
  547. Private Sub URLLink1_GoToURL(URL As String, Cancel As Boolean)
  548.     Text1.Text = results.LocationURL
  549.     URL = Text1.Text
  550. End Sub
  551. Public Sub CreateIcon()
  552.     Dim Tic As NOTIFYICONDATA
  553.     Tic.cbSize = Len(Tic)
  554.     Tic.hwnd = Picture3.hwnd
  555.     Tic.uID = 1&
  556.     Tic.uFlags = NIF_DOALL
  557.     Tic.uCallbackMessage = WM_MOUSEMOVE
  558.     Tic.hIcon = Picture3.Picture
  559.     Tic.szTip = "FireSearch" & Chr$(0)
  560.     erg = Shell_NotifyIcon(NIM_ADD, Tic)
  561. End Sub
  562. Public Sub DeleteIcon()
  563.     Dim Tic As NOTIFYICONDATA
  564.     Tic.cbSize = Len(Tic)
  565.     Tic.hwnd = Picture3.hwnd
  566.     Tic.uID = 1&
  567.     erg = Shell_NotifyIcon(NIM_DELETE, Tic)
  568. End Sub
  569. Private Sub Picture3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  570.     X = X / Screen.TwipsPerPixelX
  571.     Select Case X
  572.         Case WM_LBUTTONDOWN
  573.         mainwin.WindowState = 0
  574.         Case WM_RBUTTONDOWN
  575.         PopupMenu popmenu
  576.         Case WM_MOUSEMOVE
  577.         Case WM_LBUTTONDBLCLK
  578.         If mainwin.Visible = True Then
  579.         mainwin.Visible = False
  580.         Else
  581.         mainwin.Visible = True
  582.         End If
  583.     End Select
  584. End Sub
  585.